home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Tech Arsenal 1
/
Tech Arsenal (Arsenal Computer).ISO
/
tek-02
/
pas_0593.zip
/
MYGRAPH.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1993-05-30
|
2KB
|
71 lines
{─ Fido Pascal Conference ────────────────────────────────────────────── PASCAL ─
Msg : 436 of 457
From : Chris Lukic 1:271/29.0 27 May 93 18:42
To : William Sitch 1:163/542.0
Subj : Problems working with TP60...
────────────────────────────────────────────────────────────────────────────────
I'm not sure where this code came from, but I'd be willing to bet
it will be great deal of help.}
Unit MyGraph;
INTERFACE
Type
ColorValue = record Rvalue,Gvalue,Bvalue: byte; end;
PaleteType = array [0..255] of ColorValue;
Procedure palette(tp:paletetype);
Procedure pset(x,y:Integer;c:Byte);
Function Point(x,y:Integer):byte;
Procedure RotatePalette(var p:Paletetype;n1,n2,d:Integer);
Procedure SetVga;
IMPLEMENTATION
uses
Crt,Dos;
var n,x,y,c:integer; ch: char; i: integer; p: PaleteType; image: file; ok:
boolean;
procedure palette(tp:PaleteType);
var regs: Registers;
begin { procedure VGApalette }
with regs do
begin
AX:=$1012;
BX:=0; { first register to set }
CX:=256; { number of registers to set }
ES:=Seg(tp); DX:=Ofs(tp);
end;
Intr($10,regs);
end; { procedure SetVGApalette }
procedure Pset(x,y: integer; c: byte);
begin { procedure PutPixel }
mem[$A000:word(320*y+x)]:=c;
end; { procedure PutPixel }
function point(x,y: integer): byte;
begin { function GetPixel }
Point:=mem[$A000:word(320*y+x)];
end; { function GetPixel }
procedure rotatePalette(var p:Paletetype;n1,n2,d: integer);
var
q: PaleteType;
begin { procedure rotatePalette }
q:=p;
for i:=n1 to n2 do
p[i]:=q[n1+(i+d) mod (n2-n1+1)];
palette(p);
end; { procedure rotatePalette }
Procedure SetVga;
Begin
Inline($B8/$13/0/$CD/$10);
End;
END.